package com.example.mywechatprogram.mapper;

import com.example.mywechatprogram.entity.Sculpture;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SculptureMapper {
    @Select("select * from sculpture")
    List<Sculpture> request ();

    @Select("SELECT sculpture.imageUrl FROM sculpture INNER JOIN users_sculpture ON sculpture.id = users_sculpture.sculpture WHERE users_sculpture.UUID=#{UUID}")
    String query(@Param("UUID") String UUID);

    @Update("UPDATE users_sculpture SET users_sculpture.sculpture=#{id} WHERE users_sculpture.UUID=#{UUID}")
    int update(@Param("UUID") String UUID,@Param("id")int id);
}
